<?php
include_once( APPPATH.'libraries/Weibo.php' );

if (!defined('BASEPATH'))
	exit('No direct script access allowed');

class Home extends CI_Controller {

	function __construct() {
		parent::__construct();
		$this->load->model('Posts_model', '', TRUE);
	}

	public function index() {
		$this->load->library('Date');
		
	$c = new WeiboClient($this->config->item('wb_app_key') ,$this->config->item('wb_app_secret') );
		$data['weibo_message'] = $c->user_timeline(1, 3, 1681641504);
		$data['posts'] = $this->Posts_model->get_posts(3, 0);
		$data['page_title'] = 'welcome to ouyoyo`s blog';
		$data['page_description'] = '欢迎来到 ouyoyo,此程序由 Codeigniter 驱动的开源博客程序。在 BSD开源协议 下发布。 前端采用 960 Grid System 布局， HTML5编码。 拥有文章发布，微博同步，评论，相册等功能。';
		$data['page_keywords'] = 'blog, Codeigniter, 960 Grid System, html5, jquery';

		$this->load->view('home/index', $data);
	}

}  